import TabsView from '@/layouts/tabs/TabsView'
import PageView from '@/layouts/PageView'

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: () => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: () => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: () => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [

        {
          name: '首页',
          path: 'dashboard/workplace',
          meta: {
            icon: 'home'
          },
          component: () => import('@/pages/screen')
        },
        {
          path: 'device',
          name: '设备管理',
          meta: {
            icon: 'desktop',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'manage',
              name: '设备管理',
              component: () => import('@/pages/device/manage'),
            },
            {
              path: 'details',
              name: '设备详情',
              meta: {
                invisible: true
              },
              component: () => import('@/pages/device/details'),
            },
            {
              path: 'terminal',
              name: '终端管理',
              component: () => import('@/pages/device/terminal'),
            },
            {
              path: 'remote-upgrade',
              name: '远程升级',
              component: () => import('@/pages/device/remote-upgrade'),
            },
          ]
        },
        {
          path: 'datas',
          name: '数据管理',
          meta: {
            icon: 'fund',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'index',
              name: '数据管理',
              component: () => import('@/pages/datas'),
            },
          ]
        },
        {
          path: 'monitor',
          name: '监控中心',
          meta: {
            icon: 'alert',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'early-warning',
              name: '预警总览',
              component: () => import('@/pages/monitor/early-warning'),
            },
            {
              path: 'vibration',
              name: '振动监测',
              component: () => import('@/pages/monitor/vibration'),
            },
            {
              path: 'video',
              name: '监控视频',
              component: () => import('@/pages/monitor/video'),
            },
            {
              path: 'monitor-device',
              name: '设备列表',
              meta: {
                highlight: '/monitor/video',
                invisible: true
              },
              component: () => import('@/pages/monitor/monitor-device'),
            },
            {
              path: 'monitor-video',
              name: '监控视频',
              meta: {
                highlight: '/monitor/video',
                invisible: true
              },
              component: () => import('@/pages/monitor/monitor-video'),
            }

          ]
        },
        {
          path: 'rule-engine',
          name: '规则引擎',
          meta: {
            icon: 'stock',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'index',
              name: '规则引擎',
              component: () => import('@/pages/rule-engine'),
            },
          ]
        },
        {
          path: 'system',
          name: '系统管理',
          meta: {
            icon: 'setting',
            page: {
              cacheAble: false
            }
          },
          component: PageView,
          children: [
            {
              path: 'organization',
              name: '组织管理',
              component: () => import('@/pages/system/organization'),
            },
            {
              path: 'roles',
              name: '角色管理',
              component: () => import('@/pages/system/roles'),
            },
            {
              path: 'users',
              name: '用户管理',
              component: () => import('@/pages/system/users'),
            }
          ]
        },
      ]
    },
  ]
}

export default options
